using System.Collections.Generic;
using OracleInternal.Common;

namespace OracleInternal.BulkCopy
{
	internal class BulkCopyRows
	{
		private bool m_bTimeout;

		internal int m_columnCount;

		internal int m_numOfRowsProcessed;

		internal ColumnDescribeInfo[] m_columnsMetaData;

		internal bool m_bAllfastColumns;

		internal List<BulkCopyBindingRow> m_bindingRows;

		internal bool Timeout => m_bTimeout;

		internal BulkCopyRows(ColumnDescribeInfo[] columnsMetadata)
		{
			m_columnsMetaData = columnsMetadata;
			m_columnCount = columnsMetadata.Length;
			m_bindingRows = new List<BulkCopyBindingRow>();
			m_bAllfastColumns = IsAllFastType(m_columnsMetaData);
		}

		internal void Reset()
		{
			m_bindingRows.Clear();
			m_numOfRowsProcessed = 0;
		}

		internal static bool IsFastType(int typeCode)
		{
			if (typeCode != 1 && typeCode != 96 && typeCode != 185 && typeCode != 188 && typeCode != 186 && typeCode != 180 && typeCode != 187 && typeCode != 231 && typeCode != 232 && typeCode != 181 && typeCode != 188 && typeCode != 182 && typeCode != 189 && typeCode != 183 && typeCode != 190 && typeCode != 2 && typeCode != 12 && typeCode != 23 && typeCode != 100 && typeCode != 101 && typeCode != 6)
			{
				return typeCode == 252;
			}
			return true;
		}

		internal static bool IsAllFastType(ColumnDescribeInfo[] columnsMetaData)
		{
			bool flag = true;
			int num = 0;
			while (flag && num < columnsMetaData.Length)
			{
				flag = IsFastType(columnsMetaData[num].m_dataType);
				num++;
			}
			return flag;
		}
	}
}
